package com.example.tms.mapper;

import com.example.tms.bean.UserView;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
 * 用户视图
 */
public interface UserVMapper extends JpaRepository<UserView, String>, JpaSpecificationExecutor<UserView> {

    //查询用户信息（用户名）
    @Query(value = "select * from user where yhm = ?1 and sfcz = true", nativeQuery = true)
    UserView findByYhm(String yhm);

    //查询用户信息（用户id）
    @Query(value = "select * from user where yhid = ?1 and sfcz = true", nativeQuery = true)
    UserView findByYhid(String yhid);

}
